﻿using System;
using System.ServiceModel;
using SilenthinkContract.Component;
using SilenthinkContract.Domain;
using System.Collections.Generic;

namespace SilenthinkContract
{
    [ServiceContract(Namespace = ServiceContract.Namespace)]
    public interface IStoreService : IService
    {
        [OperationContract]
        bool CreateProductCategory(ProductCategory o);
        [OperationContract]
        IList<ProductCategory> GetProductCategories(bool? status = null);

        [OperationContract]
        bool CreateProduct(Product o);
        [OperationContract]
        bool UpdateProduct(Product o);
        [OperationContract]
        bool DeleteProduct(long id);

        [OperationContract]
        Product GetProduct(long id, bool inclExtra = false, bool inclVariants = false);
        [OperationContract]
        PageList<Product> GetPagedProductList(int size = 20, int index = 1, string name = null);

        [OperationContract]
        bool CreateProductAttributeName(ProductAttributeName attributeName);
        [OperationContract]
        IList<ProductAttributeName> GetProductAttributeName(string productCategoryCode, string parentAttributeNameCode, int? id = null, bool? status = null);

        [OperationContract]
        bool CreateProductAttributeValue(ProductAttributeValue attributeValue);
        [OperationContract]
        IList<ProductAttributeValue> GetProductAttributeValue(string productCategoryCode, bool byAttributeNameCode,
                                                              string[] attributeNameCodeArray, int? id = null,
                                                              bool? status = null);

        #region Discount

        [OperationContract]
        bool CreateDiscount(Discount o);
        [OperationContract]
        Discount GetDiscount(int id);

        [OperationContract]
        PageList<Discount> GetPagedDiscount(int size = 20, int index = 1, DiscountAssignedTo? assignedTo = null, bool? usePercentage = null, bool? status = null);

        [OperationContract]
        bool CreateDiscountRequirement(DiscountRequirement o);
        [OperationContract]
        IList<DiscountRequirement> GetDiscountRequirement(int discountId);

        [OperationContract]
        IList<Discount> GetAvailableDiscount();

        [OperationContract]
        bool ValidateDiscount(int discountId, int limitationTimes, long? userId);

        #endregion
        
        #region ProductAdvisory
        [OperationContract]
        bool CreateProductAdvisory(ProductAdvisory o);
        [OperationContract]
        bool UpdateProductAdvisory(ProductAdvisory o);
        [OperationContract]
        bool DeleteProductAdvisory(long id);
        [OperationContract]
        ProductAdvisory GetProductAdvisory(long id);
        [OperationContract]
        PageList<ProductAdvisory> GetPagedProductAdvisory(int index = 1, int size = 20, long? productId = null,
                                                          int? userId = null, string createdBy = null,
                                                          DateTime? createdOn = null, DateTime? answerTime = null,
                                                          ProductAdvisoryCategory? category = null,
                                                          ProductAdvisoryStatus? status = null);
        #endregion

        #region ProductReview
        [OperationContract]
        bool CreateProductReview(ProductReview o);
        [OperationContract]
        bool UpdateProductReview(ProductReview o);
        [OperationContract]
        bool DeleteProductReview(long id);
        [OperationContract]
        ProductReview GetProductReview(long id);
        [OperationContract]
        PageList<ProductReview> GetPagedProductReview(int index = 1, int size = 20, long? productId = null,
                                                          int? userId = null, string createdBy = null,
                                                          DateTime? createdOn = null,
                                                          ProductReviewStatus? status = null);
       
        #endregion 
        
    }
}